using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace sCicero
{
    public partial class template_new : Form
    {
        private sCicero.scicero m_osCicero;
        private string m_sNewTemplateData;
        public template_new(ref sCicero.scicero osCicero, string sData)
        {
            m_osCicero = osCicero;
            m_sNewTemplateData = sData;
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (this.textBox1.Text.Trim() != "")
            {
                m_osCicero.Templates.New(this.textBox1.Text.Trim(), m_sNewTemplateData);
                m_osCicero.Event.Raise_UpdateRequest(this, "Ny mall skapad (" + this.textBox1.Text.Trim() + ")", true);
                this.Close();
            }
            else
                MessageBox.Show("Fyll i ett namn!");
        }
    }
}